package edu.cuny.baruch.cis9590.library.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="holds")
public final class Hold {
    
    private int id;
    private int bookId;
    private int patronId;
    private Date holdDate;
    
    public Hold() {
    }
    
    public Hold(int bookId, int patronId, Date holdDate) {
        this.bookId = bookId;
        this.patronId = patronId;
        this.holdDate = holdDate;
    }
    
    @Id
    @Column(name="hold_id")
    @GeneratedValue(generator="increment")
    @GenericGenerator(name="increment", strategy="increment")
    public int getId() {
        return id;
    }
    
    @Column(name="book_id")
    public int getBookId() {
        return bookId;
    }
    
    @Column(name="patron_id")
    public int getPatronId() {
        return patronId;
    }
    
    @Column(name="hold_date")
    public Date getHoldDate() {
        return holdDate;
    }
    
    public void setBookId(int bookId) {
        this.bookId = bookId;
    }
    
    public void setHoldDate(Date holdDate) {
        this.holdDate = holdDate;
    }
    
	public void setId(int id) {
		this.id = id;
	}
	
	public void setPatronId(int patronId) {
	    this.patronId = patronId;
	}
}
